var srxdefaults = {
instances:[
{name:"SRX.SX",url:"srx.sx",active:true},
{name:"Spootle",url:"searx.spootle.de",active:false},
{name:"Toot.Koeln",url:"search.toot.koeln",active:false},
{name:"BKA.LI",url:"search.bka.li",active:false},
{name:"Weho.st",url:"search.weho.st",active:false}
],
autocomplete:"startpage",
safesearch:1,
engines:{
general:[
"startpage",
"qwant",
"yandex",
"bing",
"yahoo"],
images:[
"qwant+images",
"bing+images",
"duckduckgo+images",
"flickr"],
videos:[
"bing+videos",
"youtube",
"dailymotion",
"vimeo"],
map:[
"openstreetmap"],
news:[
"qwant+news",
"bing+news",
"yahoo+news"],
it:[
"bitbucket",
"gitlab",
"github",
"stackoverflow",
"framalibre"],
music:[
"soundcloud",
"youtube"],
files:[
"openrepos",
"fdroid"],
science:[
"wolframalpha",
"microsoft+academic"],
"social+media":[
"qwant+social",
"twitter",
"reddit"]
}};
if(!localStorage.getItem("instances")) localStorage.setItem("instances",JSON.stringify(srxdefaults.instances));
if(!localStorage.getItem("language")) localStorage.setItem("language",navigator.language);
if(!localStorage.getItem("autocomplete")) localStorage.setItem("autocomplete",srxdefaults.autocomplete);
if(!localStorage.getItem("safesearch")) localStorage.setItem("safesearch",srxdefaults.safesearch);
if(!localStorage.getItem("engines_general")) localStorage.setItem("engines_general",JSON.stringify(srxdefaults.engines.general));
if(!localStorage.getItem("engines_images")) localStorage.setItem("engines_images",JSON.stringify(srxdefaults.engines.images));
if(!localStorage.getItem("engines_videos")) localStorage.setItem("engines_videos",JSON.stringify(srxdefaults.engines.videos));
if(!localStorage.getItem("engines_map")) localStorage.setItem("engines_map",JSON.stringify(srxdefaults.engines.map));
if(!localStorage.getItem("engines_news")) localStorage.setItem("engines_news",JSON.stringify(srxdefaults.engines.news));
if(!localStorage.getItem("engines_it")) localStorage.setItem("engines_it",JSON.stringify(srxdefaults.engines.it));
if(!localStorage.getItem("engines_music")) localStorage.setItem("engines_music",JSON.stringify(srxdefaults.engines.music));
if(!localStorage.getItem("engines_files")) localStorage.setItem("engines_files",JSON.stringify(srxdefaults.engines.files));
if(!localStorage.getItem("engines_science")) localStorage.setItem("engines_science",JSON.stringify(srxdefaults.engines.science));
if(!localStorage.getItem("engines_social+media")) localStorage.setItem("engines_social+media",JSON.stringify(srxdefaults.engines["social+media"]));
srxsettings = {
instances:JSON.parse(localStorage.getItem("instances")),
language:localStorage.getItem("language"),
autocomplete:localStorage.getItem("autocomplete"),
safesearch:localStorage.getItem("safesearch"),
engines:{
general:JSON.parse(localStorage.getItem("engines_general")),
images:JSON.parse(localStorage.getItem("engines_images")),
videos:JSON.parse(localStorage.getItem("engines_videos")),
map:JSON.parse(localStorage.getItem("engines_map")),
news:JSON.parse(localStorage.getItem("engines_news")),
it:JSON.parse(localStorage.getItem("engines_it")),
music:JSON.parse(localStorage.getItem("engines_music")),
files:JSON.parse(localStorage.getItem("engines_files")),
science:JSON.parse(localStorage.getItem("engines_science")),
"social+media":JSON.parse(localStorage.getItem("engines_social+media"))
}};